/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
/*
* Functions for drawing simple objects with opengl. 
* Normals included, backface culling is a ok, when using ccw-order for frontface 
* These are optimized for being used in display lists
*/

#ifndef DRAWUTILS_H
#define DRAWUTILS_H

#include <cstdlib>
#include "mathutils.h"
#include "GL/gl.h"
#include "GL/glu.h"
#include <string>

//Draws a box with center on the middle and dimensions w,h and l 
//(along x,y and z-axes respectively)
void drawBoxTextured(float w, float h, float l, GLuint aTextureID);
void drawBox(float w, float h, float l);
void drawBox(float w, float h, float l, float x, float y, float z);

// draws a sphere of radius r
//d is detail level i.e. amount of slices and stacks
void drawSphere(float r, int d);
void drawSphere(float r, int d, float x, float y, float z);
//draws a cylinder with radius r and height h measured along z axis
//d is detail level
void drawCylinder(float r, float h, int d);
void drawCylinder(float r, float h, int d, float x, float y, float z);
//draws a capsule (cylinder with spherical ends) with height h and radius r, 
//height is measured between the centers of the spheres along z-axis
//void drawCapsule(float r, float h, int d);

//draws a plane with w width (x-axis), and h height (z-axis), centered at 0,0,0
void drawPlane(float w, float h);


void drawMesh(float *vertices, int vertexCount, int* indices, int indexCount);

#endif //DRAWUTILS_H
